package flextestng.testing.model
{
	import flash.system.ApplicationDomain;
	import flash.utils.describeType;
	
	import flextestng.testing.utils.ClassUtils;
	
	public class ClassDefinition
	{
		private var _excludedGroups:Array;
		private var _includedGroups:Array;
		
		public function ClassDefinition(className:String, includedGroups:Array, excludedGroups:Array)
		{
			_className = className;
			_includedGroups = includedGroups;
			_excludedGroups = excludedGroups;
		}
		
		protected function findTestMethods(clazz:Class):Array
		{
			return ClassUtils.getMethodsForMetatag(clazz, "Test");
		}
		
		protected function getClassDescriptor(clazz:Class):XML
		{
			return describeType(clazz);
		}
		
		private var _className:String;
		public function get className():String
		{
			return _className;
		}
		
		public function get clazz():Class
		{
			return Class( ApplicationDomain.currentDomain.getDefinition(className) );
		}
		
		public function get excludedMethods():Array
		{
			return [];
		}
		
		public function get includedMethods():Array
		{
			return findTestMethods(clazz);
		}
	}
}